package pokerStat.tool;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;

public abstract class HHFileReader {

	public static ArrayList<String> getHHStrings(String file)
			throws IOException {
		BufferedReader bread = new BufferedReader(new FileReader(file));

		ArrayList<String> hhStrings = new ArrayList<String>();
		String line = "", hhStr = "";
		while ((line = bread.readLine()) != null) {
			if (!line.isEmpty()) {
				if (!hhStr.isEmpty())
					hhStr += "\n";
				hhStr += line;
			}
			if (line.isEmpty() && !hhStr.isEmpty()) {
				hhStr = hhStr.replaceAll("'", "`") + "\n";
				hhStrings.add(new String(hhStr));
				hhStr = "";
			}
		}

		return hhStrings;
	}

}
